#include "Application.h"

using namespace std;

/// <summary>
/// Constructor
/// </summary>
CIApp::Application::Application() {
    using namespace CIGui;

    mw = new MainWindow();      //Creates the application main window
}

/// <summary>
/// Destructor
/// </summary>
CIApp::Application::~Application() {
    delete mw;                  //Deletes the main window

    //Deleting all operations into undoableOps stack
    while (undoableOps.size()) {
        delete undoableOps.top();
        undoableOps.pop();
    }

    //Deleting all operations into redoableOps stack
    while (redoableOps.size()) {
        delete redoableOps.top();
        redoableOps.pop();
    }
}

/// <summary>
/// Method called to run the application
/// </summary>
void CIApp::Application::Run() {
    mw->showMaximized();
}
